/*
 * @Author: Zhang Yingying
 * @Date: 2020-11-05 10:40:36
 * @LastEditors: Zhang Yingying
 * @LastEditTime: 2020-12-03 22:20:25
 */
import request from '@/utils/request'
import BaseApi from './BaseApi'

export class LoginApi extends BaseApi {
  login(data) {
    return request({
      url: '/login/admin',
      method: 'post',
      data,
    })
  }

  getInfo() {
    return request({
      url: '/userInfo',
      method: 'get',
    })
  }

  logout() {
    return Promise.resolve({
      code: 200,
      data: null,
      message: '退出登录成功',
    })
  }

  register() {
    return request({
      url: '/register',
      method: 'post',
    })
  }
}

export default new LoginApi()
